package com.jxw.launcher.db;

import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.util.Log;

/* loaded from: classes.dex */
public class PasswordSetHelper {
    private static final String COLUMN_CHECK = "checked";
    private static final String COLUMN_NAME = "setname";
    private static final String NAME_ANDROID_SYSTEM = "安卓平台";
    private static final String NAME_APK_INSTALL = "安装APK软件";
    private static final String TAG = "PasswordSetHelper";
    public static final int TYPE_ANDROID_SYSTEM = 1;
    public static final int TYPE_APK_INSTALL = 2;
    private static final String URI_STRING = "content://com.jxw.quanxiancontentprovider1/quanxianset";

    public static boolean isChecked(ContentResolver contentResolver, int i) {
        String[] strArr;
        boolean z = true;
        if (contentResolver == null) {
            Log.i(TAG, "isChecked():resolver == null");
            return true;
        }
        if (i == 1) {
            strArr = new String[]{NAME_ANDROID_SYSTEM};
        } else if (i != 2) {
            return true;
        } else {
            strArr = new String[]{NAME_APK_INSTALL};
        }
        Cursor query = contentResolver.query(Uri.parse(URI_STRING), null, "setname=?", strArr, null);
        if (query != null) {
            while (true) {
                if (!query.moveToNext()) {
                    break;
                }
                String string = query.getString(query.getColumnIndex("checked"));
                if (!string.equals("0")) {
                    if (string.equals("1")) {
                        z = false;
                        break;
                    }
                } else {
                    break;
                }
            }
            query.close();
        }
        return z;
    }
}
